package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.CustomerMapper;
import com.atguigu.jxc.entity.Customer;
import com.atguigu.jxc.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class CustomerServiceimpl implements CustomerService {

    @Autowired
    CustomerMapper customerMapper;

//客户列表分页（名称模糊查询）
    @Override
    public ArrayList<Customer> list(Integer page, Integer rows, String customerName) {
             return   customerMapper.list(page,rows,customerName);
    }

    //添加
    @Override
    public void save(Customer customer) {
          customerMapper.save(customer);
    }

    //修改
    @Override
    public void update(Customer customer) {
        customerMapper.update(customer);
    }

    //删除
    @Override
    public void delete(Integer ids) {
          customerMapper.delete(ids);
    }
}
